package ProxyPattern

type TextReaderProxy struct {
	reader *TextReader
}

func (t *TextReaderProxy) LoadFile(filename string) {
	if t.reader == nil {
		t.reader = &TextReader{}
	}
	t.reader.FileName = filename
}

func (t *TextReaderProxy) PrintOutFile() {
	if t.reader == nil {
		t.reader = &TextReader{}
	}
	t.reader.LoadFile(t.reader.FileName)
	t.reader.PrintOutFile()
	t.reader = nil
}
